---悠衣技能3 随机一名近战队友
---@class SkillEffect203300:BaseSkillEffect
SkillEffect203300 = ClientFight.CreateClass("SkillEffect203300",ClientFight.BaseSkillEffect)
local t = SkillEffect203300
function t:prepareSkill(skill, position)
    return false;
end

function t:releaseSkill(skill)
    return false;
end

function t:attack(skill, target)
    return false;
end
---@param fight Fight
---@param fighter Fighter
---@param skill FightSkill
---@param center Vector2
---@param excludes table<number,boolean>
---@return Fighter
function t:selectAttackTarget( fight, fighter, skill, center,excludes)
    local skillBean = skill.skillBean
    -- 先选择可攻击目标
    local targets = SkillManager.selectAttackTargets(fight, fighter, skill, skillBean.f_TargetRule,
    skillBean.f_Target, AttackUtils.getAttackRadius(fighter, skill), AttackUtils.getAttackShape(fighter, skill),
    fighter.position, skillBean.f_TagActivate, nil);

    local list = {}
    for k,v in pairs(targets) do
        if not v:isRangedCLass() then
            table.insert(list,v)
        end
    end
    -- 远程职业不为空，随机选择一个
    if(#list== 0) then
        local target = targets[fight:random(#targets)];
        return target;
    end

    return nil
end

t.New()